﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/philadmin/Philadmin.Master" CodeBehind="EditGallery.aspx.vb" Inherits="Phila.EditGallery" %>
    
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%-- <script type="text/javascript" src="../Scripts/jquery.MultiFile.js"></script>--%>
    <script type="text/javascript">
        $(function () {
            $("span.cmbtour").hide();
            $("#ContentPlaceHolder1_ajaxFileUpload_UploadOrCancelButton").click(function () {
                var cmb = $("#ContentPlaceHolder1_cmbTours").val();
                if (cmb == 0) {
                    $("span.cmbtour").show();
                    $(".ajax__fileupload_queueContainer, .ajax__fileupload_fileItemInfo").hide();
                    return false;
                }
            });
        });
        function showError() {
            alert("Errors has occured");
        }
        function uploadComplete(sender, args) {
            //var type = document.getElementById("ContentPlaceHolder1_txtType").value;
            window.location = "ViewGallery.aspx?type=" + document.getElementById("ContentPlaceHolder1_hdType").value;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="98%" cellpadding="2" cellspacing="2" align="center">
        <tr>
            <td>
                <h1>
                    Add/Edit Gallery</h1>
                <fieldset>
                    <legend>Image<b> Details</b></legend>
                    <table width="98%" align="center" cellpadding="2" cellspacing="2">
                        <tr>
                            <td align="left" colspan="2">
                                <asp:Label ID="lblMsg" runat="server" CssClass="message red" Visible="true"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Tour <asp:HiddenField ID="hdType" runat="server" />
                            </td>
                            <td>
                                <asp:DropDownList ID="cmbTours" runat="server" AutoPostBack="true" CssClass="form-text">
                                </asp:DropDownList>
                                <span class="cmbtour red">Please select Tour</span>
                            </td>
                        </tr>
                        <%--<tr>
                            <td>Caption</td>
                            <td>
                                <asp:TextBox ID="txtSummary" runat="server" TextMode="MultiLine" Rows="5" Columns="50"></asp:TextBox>
                            </td>
                        </tr>--%>
                        <tr>
                            <td colspan="2">
                                <asp:ScriptManager ID="ScriptManager1" runat="server">
                                </asp:ScriptManager>
                                <asp:AjaxFileUpload ID="ajaxFileUpload" runat="server" AllowedFileTypes="jpg,jpeg,gif,png"
                                    Enabled="False" OnClientUploadComplete="uploadComplete" />
                            </td>
                        </tr>
                        <asp:Panel ID="plGallery" runat="server" Visible="false">
                            <tr>
                                <td colspan="2">
                                    Edit Gallery
                                    <asp:DataList ID="dlGallery" runat="server">
                                        <ItemTemplate>
                                            <asp:HiddenField ID="gID" runat="server" Value='<%# Eval("Id")%>' />
                                            <asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("Thumbnail","/Images/img/{0}")%>' Width="100px" />
                                            <asp:LinkButton ID="btnRemove" runat="server" Text="Remove" OnClick="btnRemove_Click"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:DataList>
                                </td>
                            </tr>
                        </asp:Panel>
                    </table>
                </fieldset>
                <br />
                <br />
                <%-- <fieldset>
                    <table width="98%" cellpadding="2" cellspacing="2" align="center">
                        <tr>
                            <td colspan="2" align="center">
                                <asp:Button ID="btnSave" runat="server" Text="Save" ValidationGroup="submit" CssClass="form-button" />&nbsp;&nbsp;
                                <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="form-button" />
                            </td>
                        </tr>
                    </table>
                </fieldset>--%>
                <br />
                <br />
            </td>
        </tr>
    </table>
</asp:Content>
